home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / ddx / Xsun / RCS / sunCursor.c,v < prev    next >
Encoding:
Text File  |  1990-03-04  |  2.5 KB  |  121 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     90.02.16.17.40.09;  author tve;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @Original X11R4 distribution
  17. @
  18.  
  19.  
  20.  
  21. 1.1
  22. log
  23. @Initial revision
  24. @
  25. text
  26. @/*-
  27.  * sunCursor.c --
  28.  *    Functions for maintaining the Sun software cursor...
  29.  *
  30.  */
  31.  
  32. #define NEED_EVENTS
  33. #include    "sun.h"
  34. #include    <windowstr.h>
  35. #include    <regionstr.h>
  36. #include    <dix.h>
  37. #include    <dixstruct.h>
  38. #include    <opaque.h>
  39.  
  40. #include    <servermd.h>
  41. #include    "mipointer.h"
  42.  
  43. /*
  44.  * The following struct is from win_cursor.h.  This file can't be included 
  45.  * directly, because it drags in all of the SunView attribute stuff along 
  46.  * with it.
  47.  */
  48.  
  49. #ifdef SUN_WINDOWS
  50.  
  51. struct cursor {
  52.     short       cur_xhot, cur_yhot;    /* offset of mouse position from shape */
  53.     int         cur_function;        /* relationship of shape to screen */
  54.     struct pixrect *cur_shape;        /* memory image to use */
  55.     int         flags;            /* various options */
  56.     short       horiz_hair_thickness;    /* horizontal crosshair height */
  57.     int         horiz_hair_op;        /* drawing op       */
  58.     int         horiz_hair_color;    /* color            */
  59.     short       horiz_hair_length;    /* width           */
  60.     short       horiz_hair_gap;        /* gap             */
  61.     short       vert_hair_thickness;    /* vertical crosshair width  */
  62.     int         vert_hair_op;        /* drawing op       */
  63.     int         vert_hair_color;    /* color            */
  64.     short       vert_hair_length;    /* height           */
  65.     short       vert_hair_gap;        /* gap              */
  66. };
  67. #endif SUN_WINDOWS
  68.  
  69. void
  70. sunInitCursor ()
  71. {
  72.     if ( sunUseSunWindows() ) {
  73. #ifdef SUN_WINDOWS
  74.     static struct cursor cs;
  75.     static struct pixrect pr;
  76.     /* 
  77.      * Give the pixwin an empty cursor so that the kernel's cursor drawing 
  78.      * doesn't conflict with our cursor drawing.
  79.      */
  80.     cs.cur_xhot = cs.cur_yhot = cs.cur_function = 0;
  81.     cs.flags = 0;
  82.     cs.cur_shape = ≺
  83.     pr.pr_size.x = pr.pr_size.y = 0;
  84.     win_setcursor( windowFd, &cs );
  85. #endif SUN_WINDOWS
  86.     }
  87. }
  88.  
  89.  
  90. #ifdef SUN_WINDOWS
  91. /*
  92.  * We need to find out when dix warps the mouse so we can
  93.  * keep SunWindows in sync.
  94.  */
  95.  
  96. Bool (*realSetCursorPosition)();
  97. extern int sunIgnoreEvent;
  98.  
  99.  
  100. Bool
  101. sunSetCursorPosition(pScreen, x, y, generateEvent)
  102.     ScreenPtr pScreen;
  103.     int x, y;
  104.     Bool generateEvent;
  105. {
  106.     (*realSetCursorPosition)(pScreen, x, y, generateEvent);
  107.     if (sunUseSunWindows())
  108.         if (!sunIgnoreEvent)
  109.         win_setmouseposition(windowFd, x, y);
  110.     return TRUE;
  111. }
  112. #endif
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120. @
  121.